package com.forum.module.blog.dal.dataobject.article_tag;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.forum.framework.mybatis.core.dataobject.BaseDO;

import java.util.Objects;

/**
 * 功能:
 * 作者:ouyzh
 * 日期:2025/3/2 18:02
 */
@TableName(value = "blog_article_tag")
public class ArticleTagDO extends BaseDO {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 文章编号
     */
    private Long articleId;

    /**
     * 标签编号
     */
    private Long tagId;

    public ArticleTagDO() {
    }

    public ArticleTagDO(Long id, Long articleId, Long tagId) {
        this.id = id;
        this.articleId = articleId;
        this.tagId = tagId;
    }

    public Long getId() {
        return id;
    }

    public ArticleTagDO setId(Long id) {
        this.id = id;
        return this;
    }

    public Long getArticleId() {
        return articleId;
    }

    public ArticleTagDO setArticleId(Long articleId) {
        this.articleId = articleId;
        return this;
    }

    public Long getTagId() {
        return tagId;
    }

    public ArticleTagDO setTagId(Long tagId) {
        this.tagId = tagId;
        return this;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        ArticleTagDO that = (ArticleTagDO) object;
        return Objects.equals(id, that.id) && Objects.equals(articleId, that.articleId) && Objects.equals(tagId, that.tagId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, articleId, tagId);
    }
}
